/**
 * 自定义CSS样式
 *
 * @author AI Crawlers Team
 * @date 2025-10-10
 */

/* ==================== 整体布局 ==================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    background-color: #fff;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 56px);
    padding-top: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 12px 20px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
    border-left-color: #007bff;
}

.sidebar .nav-link.active {
    color: #007bff;
    background-color: #e7f3ff;
    border-left-color: #007bff;
}

.sidebar .nav-link.disabled {
    color: #999;
    cursor: not-allowed;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* ==================== 主内容区 ==================== */
#main-content {
    margin-left: 250px;
    padding: 20px;
}

#content-area {
    min-height: 600px;
}

/* ==================== 导航栏 ==================== */
.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ==================== 卡片 ==================== */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    border: none;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f0f0f0;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* ==================== 表格 ==================== */
.table {
    font-size: 14px;
}

.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* ==================== 按钮 ==================== */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

/* ==================== 徽章 ==================== */
.badge {
    padding: 0.4em 0.7em;
    font-weight: 500;
    border-radius: 4px;
}

/* ==================== 表单 ==================== */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-control:focus,
.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* ==================== 模态框 ==================== */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.modal-title {
    font-weight: 600;
}

/* ==================== 数据看板特殊样式 ==================== */
.dashboard-page .card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.dashboard-page .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dashboard-page h2 {
    margin: 0;
    font-weight: 700;
}

.dashboard-page .alert {
    margin-bottom: 0;
}

/* ==================== 列表组 ==================== */
.list-group-item {
    border: 1px solid rgba(0,0,0,.125);
    margin-bottom: -1px;
}

.list-group-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.list-group-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.list-group-item-action:hover {
    background-color: #f8f9fa;
}

/* ==================== DataTables优化 ==================== */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.375rem 0.75rem;
    margin: 0 2px;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #007bff;
    color: white !important;
    border: 1px solid #007bff;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 1rem;
}

/* ==================== 加载动画 ==================== */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        height: auto;
    }
    
    #main-content {
        margin-left: 0;
    }
}

/* ==================== 自定义工具类 ==================== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* ==================== 竞品分析页面 ==================== */
.competitor-analysis-page .alert {
    text-align: center;
    font-size: 1.1rem;
}

.competitor-analysis-page .alert strong {
    font-size: 1.5rem;
    display: block;
    margin-top: 5px;
}

/* ==================== 竞品配置表格 ==================== */
#competitorListBody tr:hover {
    background-color: #f8f9fa;
}

/* ==================== 空状态 ==================== */
#emptyState {
    background-color: #fff;
    border-radius: 8px;
    padding: 3rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

